package website.lucaswork.survey.core.hessian;

import com.caucho.hessian.io.AbstractHessianOutput;
import com.caucho.hessian.io.AbstractSerializer;

import java.io.IOException;
import java.time.LocalDate;

public class LocalDateSerializer extends AbstractSerializer {
    @Override
    public void writeObject(Object obj, AbstractHessianOutput out) throws IOException {
        LocalDate date = (LocalDate) obj;
        out.writeInt(date.getYear());
        out.writeInt(date.getMonthValue());
        out.writeInt(date.getDayOfMonth());
    }
}
